#!/bin/bash

# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

for stud in /home/students/*; do 
	chattr -i $stud/{.screenrc,.bashrc} 1> /dev/null 2> /dev/null
	printf "multiuser on\nacladd baevs\n" > $stud/.screenrc; 
	cp ./bashrc.template $stud/.bashrc
	chattr +i $stud/{.screenrc,.bashrc} 1> /dev/null 2> /dev/null
done
